Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote table name with backticks to escape special characters in spark.read.table() #224

Merged
merged 4 commits into from
Jan 12, 2024

Conversation

seankao-az
Copy link
Collaborator

Description

Quote table name with backticks to escape special characters in spark.read.table()
Follow up on

which allows for creating flint index on table name with special characters, but build() on these index fails if table name not escaped by backticks (`)

Issues Resolved

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Sean Kao <seankao@amazon.com>
Signed-off-by: Sean Kao <seankao@amazon.com>
Signed-off-by: Sean Kao <seankao@amazon.com>
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dai-chen dai-chen added bug Something isn't working backport 0.1 labels Jan 12, 2024
@seankao-az
Copy link
Collaborator Author

Missed that one.. added the change.
Not quite sure how to test this one in UT, though. In IT we cannot create table with special characters due to spark table identifier constraint.

Signed-off-by: Sean Kao <seankao@amazon.com>
@dai-chen
Copy link
Collaborator

Missed that one.. added the change. Not quite sure how to test this one in UT, though. In IT we cannot create table with special characters due to spark table identifier constraint.

No problem. Should be fine if all existing IT can pass. Thanks!

Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@dai-chen dai-chen merged commit 6e163e7 into opensearch-project:main Jan 12, 2024
4 checks passed
@opensearch-trigger-bot
Copy link

The backport to 0.1 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/opensearch-spark/backport-0.1 0.1
# Navigate to the new working tree
pushd ../.worktrees/opensearch-spark/backport-0.1
# Create a new branch
git switch --create backport/backport-224-to-0.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6e163e77a2d8598ad105835f3ce20677d84fea84
# Push it to GitHub
git push --set-upstream origin backport/backport-224-to-0.1
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-spark/backport-0.1

Then, create a pull request where the base branch is 0.1 and the compare/head branch is backport/backport-224-to-0.1.

seankao-az added a commit to seankao-az/opensearch-spark that referenced this pull request Jan 12, 2024
….read.table() (opensearch-project#224)

* quote table name for special character in df read

Signed-off-by: Sean Kao <seankao@amazon.com>

* add UT

Signed-off-by: Sean Kao <seankao@amazon.com>

* update comments; scalafmtAll

Signed-off-by: Sean Kao <seankao@amazon.com>

* add a missed table name to quote

Signed-off-by: Sean Kao <seankao@amazon.com>

---------

Signed-off-by: Sean Kao <seankao@amazon.com>
(cherry picked from commit 6e163e7)
seankao-az added a commit to seankao-az/opensearch-spark that referenced this pull request Jan 12, 2024
….read.table() (opensearch-project#224)

* quote table name for special character in df read

Signed-off-by: Sean Kao <seankao@amazon.com>

* add UT

Signed-off-by: Sean Kao <seankao@amazon.com>

* update comments; scalafmtAll

Signed-off-by: Sean Kao <seankao@amazon.com>

* add a missed table name to quote

Signed-off-by: Sean Kao <seankao@amazon.com>

---------

Signed-off-by: Sean Kao <seankao@amazon.com>
(cherry picked from commit 6e163e7)
dai-chen pushed a commit that referenced this pull request Jan 12, 2024
….read.table() (#224) (#225)

* quote table name for special character in df read

Signed-off-by: Sean Kao <seankao@amazon.com>

* add UT

Signed-off-by: Sean Kao <seankao@amazon.com>

* update comments; scalafmtAll

Signed-off-by: Sean Kao <seankao@amazon.com>

* add a missed table name to quote

Signed-off-by: Sean Kao <seankao@amazon.com>

---------

Signed-off-by: Sean Kao <seankao@amazon.com>
(cherry picked from commit 6e163e7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 0.1 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants